<template>
	<view >
		<uni-popup ref="popup" @change="initAddComment" type="center">
			<view  class="mask">
			<view  class="mask_outbox">
				<view  class="mask_inbox animation-scale-up" style="background-color: rgb(255, 255, 255);">
		
			<text class="_box-times f_right" @click="close()">关闭</text>	
					<view >
						<view class="_singbox">
							<view  class="_singbox-title">{{formTitle[1].text}}</view>
							<view  class="_singbox-tips" ></view>
							<view  class="_singbox-phone">
								<view class="uni-input-wrapper">
									<view class="uni-input-placeholder input-placeholder" style="color: rgb(204, 204, 204);"  >请输入手机号</view>
									<input maxlength="140" step="0.000000000000000001" enterkeyhint="done" pattern="[0-9]*" autocomplete="off" type="number" class="uni-input-input"><!----></view>
									</view><button  class="_singbox-btn" type="warn" style="background-color: rgb(242, 48, 74);" @click="addCommentOrReply()">提交</button>
							<view  class="_singbox-tips _singbox-tips_two" style="margin-top: 10px;">{{ appName }} 保障无骚扰电话，并对信息进行保密</view></view></view></view></view>
			</view>
			
			
		</uni-popup> 
	</view>
</template>

<script>
/**
 * @des 点击item 显示popup
 *
 * @author stav stavyan@qq.com
 * @date 2020-04-16 11:15
 */
import uniPopup from '@/components/uni-popup/uni-popup.vue';
export default {
	components: {
		uniPopup
	},
	methods: {
		//20221008
		// 显示协议popup
		/*初始化添加评论*/
		if (isflag) {
			// #ifndef MP
			this.$refs.popup.open()
			// #endif
		},
		close(){
		this.$refs.popup.close()//关闭弹出层
		},
		/*添加评论或回复*/
		addCommentOrReply() {
			if (this.commentContent == '') {
				this.$mHelper.toast('评论内容不能为空');
				return;
			}
			if (this.replyCommentId > 0) {
				this.addReply();
			} else {
				this.addComment();
			}
		},
		
		/*添加评论*/
		async addComment() {
			let formData = {
				bizId: this.id,
				bizType: '1',
				content: this.commentContent,
				pageSize: this.pageSize
			}
			let res = await this.$http.apiCall('post', '/system/comment/add', JSON.stringify(formData));
			if (res) {
				this.info.comment = res.data;
				this.showAddComment = false;
				this.commentContent = '';
				this.$mHelper.toast('评论成功');
			} else {
				this.$mHelper.toast(res.msg);
			}
		}
	}
};
</script>

<style lang="scss">
//20221009
	.mask {
	  
	 
	}
	 .mask_outbox {
	  position: fixed;
	 
	  width: 80%;
	  height: 50%;
	  top: 0;
	  left: 0;
	  right: 0;
	  bottom: 0;
	  margin: auto;
	  display: flex;
	  justify-content: center;
	  flex-direction: column;
	  z-index: 996093;
	}
	 .mask_inbox {
	  display: block;
	  background-color: #fff;
	  z-index: 996094;
	  padding: 15px;
	  -moz-border-radius: 5px;
	  -webkit-border-radius: 5px;
	  border-radius: 5px;
	}
	.mask_inbox ._box-times {
	  width: 30px;
	  height: 30px;
	  position: relative;
	  z-index: 1;
	}
	 ._singbox-title {
	  font-weight: 700;
	  font-size: 19px;
	  text-align: center;
	}
	 ._singbox ._singbox-tips {
	  font-size: 15px;
	  min-height: 20px;
	  line-height: 20px;
	  color: #8f8f8f;
	}
	._singbox ._singbox-tips_two{
	    font-size: 12px;
	    color: #ccc;
	}
	._singbox-phone {
	  margin-bottom: 10px;
	  font-size: 16px;
	  border: 1px solid rgba(0,0,0,.2);
	  padding: 10px 15px;
	  z-index: 996180;
	  box-sizing: border-box;
	}
	.uni-input-wrapper {
	  display: -webkit-box;
	  display: -webkit-flex;
	  display: flex;
	  position: relative;
	  width: 100%;
	  height: 100%;
	  -webkit-box-orient: vertical;
	  -webkit-box-direction: normal;
	  -webkit-flex-direction: column;
	  flex-direction: column;
	  -webkit-box-pack: center;
	  -webkit-justify-content: center;
	  justify-content: center;
	}
	.uni-input-placeholder {
	  position: absolute;
	  top: auto !important;
	  left: 0;
	  color: grey;
	  overflow: hidden;
	  text-overflow: clip;
	  white-space: pre;
	  word-break: keep-all;
	  pointer-events: none;
	  line-height: inherit;
	}
	.uni-input-input {
	  position: relative;
	  display: block;
	  height: 100%;
	  background: none;
	  color: inherit;
	  opacity: 1;
	  font: inherit;
	    line-height: inherit;
	  line-height: inherit;
	  letter-spacing: inherit;
	  text-align: inherit;
	  text-indent: inherit;
	  text-transform: inherit;
	  text-shadow: inherit;
	}
	 ._singbox-btn {
	  height: 33px;
	  line-height: 33px;
	  font-size: 16px;
	  color: #fff;
	}
	.uni-input-form, .uni-input-input, .uni-input-placeholder, .uni-input-wrapper {
	    outline: none;
	    border: none;
	    padding: 0;
	    margin: 0;
	    text-decoration: inherit;
	}
</style>
